{%  extends "admin/common/admin_base.html" %}
{% block title -%}
    配置字段管理
{% endblock %}
{% block page_title -%}配置字段管理{% endblock %}
{% block page_btn_name -%}修改配置字段{% endblock %}
{% block content -%}
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <form class="form-horizontal" method="POST" action="{{ url_for('adminconfig_field.edit') }}" onsubmit="return false" >
                    <input type="hidden" name="id" value="{{ data.id }}" />
                    <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <li class="active"><a href="#tab1" data-toggle="tab">基本参数</a></li>
                            <li class="pull-right"><a href="javascript:history.back(-1)" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab1">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">键</label>
                                    <div class="col-sm-7"><input class="form-control" name="k" value="{{ data.k }}" placeholder="键"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">值</label>
                                    <div class="col-sm-7"><input class="form-control" name="v" value="{{ data.v }}" placeholder="值"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">类型</label>
                                    <div class="col-sm-7"><input class="form-control" name="type" value="{{ data.type }}" placeholder="类型"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">描述</label>
                                    <div class="col-sm-7"><input class="form-control" name="desc" value="{{ data.desc }}" placeholder="描述"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">文本框提示</label>
                                    <div class="col-sm-7"><input class="form-control" name="prompt"  value="{{ data.prompt }}" placeholder="文本框提示"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">排序</label>
                                    <div class="col-sm-7"><input class="form-control" name="sorts"  value='{{ data.sorts|default(99) }}' placeholder="排序"></div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">文本类型</label>
                                    <div class="col-sm-7">
                                        <select class="form-control select2" name="texttype" style="width:100%;">
                                            <option value="text" {% if data.text == 'text'%}selected="selected"{% endif %} >text</option>
                                            <option value="textarea" {% if data.textarea == 'textarea'%}selected="selected"{% endif %} >textarea</option>
                                            <option value="select" {% if data.select == 'select'%}selected="selected"{% endif %}>select</option>
                                            <option value="image" {% if data.image == 'image'%}selected="selected"{% endif %}>image</option>
                                            <option value="file" {% if data.file == 'file'%}selected="selected"{% endif %}>file</option>
                                            <option value="flash" {% if data.flash == 'flash'%}selected="selected"{% endif %}>flash</option>
                                            <option value="media" {% if data.media == 'media'%}selected="selected"{% endif %}>media</option>
                                            <option value="password" {% if data.password == 'password'%}selected="selected"{% endif %}>password</option>
                                            <option value="content" {% if data.content == 'content'%}selected="selected"{% endif %}>content</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label">状态</label>
                                    <div class="col-sm-7">
                                        <select class="form-control select2" name="state" style="width:100%;">
                                            <option value=1 >启用</option>
                                            <option value=0 >停用</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="box-footer">
                            <div class="col-sm-2"></div>
                            <div class="col-sm-7">
                                <div class="btn-group pull-right">
                                    <button type="submit" class="btn btn-info pull-right submits" data-loading-text="&lt;i class='fa fa-spinner fa-spin '&gt;&lt;/i&gt;提交">提交</button>
                                </div>
                                <div class="btn-group pull-left">
                                    <button type="reset" class="btn btn-warning">重置</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
    <script type="text/javascript">
        $(function(){
            /*ajax页面加载icheck，有该控件的页面才需要*/
            $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
                checkboxClass: 'icheckbox_minimal-blue',
                radioClass: 'iradio_minimal-blue'
            });
            /*ajax页面加载icheck，有该控件的页面才需要*/
            $(".select2").select2({language:"zh-CN"});
        })
    </script>
{% endblock %}